import request from '@/http'

export const restAdd = (modeName: string, data: any) => {
    return request.post(`/rest/${modeName}/add`, data)
}

export const restDel = (modeName: string, data: any) => {
    return request.post(`/rest/${modeName}/del`, data)
}

export const restSoftDel = (modeName: string, data: any) => {
    return request.post(`/rest/${modeName}/softDel`, data)
}

export const restUpdate = (modeName: string, data: any) => {
    return request.post(`/rest/${modeName}/update`, data)
}

export const restGetById = (modeName: string, id: string) => {
    return request.get(`/rest/${modeName}/getById/${id}`)
}

export const restGetByPage = (modeName: string, page: number, limit: number) => {
    return request.get(`/rest/${modeName}/getByPage/${page}/${limit}`)
}

export const restGetAll = (modeName: string, params: any = {}) => {
    return request.get(`/rest/${modeName}/getAll`, params)
}

